package de.servicezombie.tcmdb.rest.vo;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import de.servicezombie.pub.r1.XmlNamespaces;

/**
 * <p>
 * A definition of a effort estimation.
 * </p>
 * <b>Example:</b>
 * 
 * <pre>
 * effort {
 *   value: 15, timeUnit: (MINUTES|HOURS|DAYS) 
 * }
 * </pre>
 * 
 * @author ChKa
 * @version n.a.
 */
@XmlRootElement(name = "effort")
@XmlAccessorType(XmlAccessType.FIELD)
public class WsEffort extends AbstractWsDomainObject<WsEffort> {

	@XmlElement(name = "value", namespace = XmlNamespaces.SERVICEZOMBIE_COMMON)
    private Integer value;
	
	@XmlElement(name = "timeUnit", namespace = XmlNamespaces.SERVICEZOMBIE_COMMON)
    private TimeUnit timeUnit = TimeUnit.UNKNOWN;	
	
	public Integer getValue() {
		return value;
	}

	public void setValue(Integer value) {
		this.value = value;
	}
	
	public TimeUnit getTimeUnit() {
		if(timeUnit == null) {
			timeUnit = TimeUnit.UNKNOWN;
		}
		return timeUnit;
	}

	public void setTimeUnit(TimeUnit timeUnit) {
		this.timeUnit = timeUnit;
	}	

}
